/////////////////////////////////////////////////////////////////////////////
// Copyright(c) 2012-2015 hujiang All Rights Reserved
// Name:        qb_base.h
// Purpose:
// Author:      syy
// Modified by:
// Created:     2014/1/3 13:08
// RCS-ID:
// Licence:
/////////////////////////////////////////////////////////////////////////////
#ifndef _PR_BASE_H_
#define _PR_BASE_H_

#include "core/comdefs.h"
#include "core/common_types.h"
#include "core/system/scoped_refptr.h"
#include "qbmessage/include/message_bond.h"
#include "qbmessage/include/message_kernel.h"
#include "qbmessage/include/message_process.h"
#include "qbmessage/include/message_sync.h"
#include "qbnet/include/network_service.h"

#if defined(WIN32) || defined(_WINDOWS)
#ifdef QBKERNEL_EXPORTS
#define QBKERNELAPI __declspec(dllexport)
#else
#define QBKERNELAPI __declspec(dllimport)
#endif
#else
#define QBKERNELAPI
#endif

namespace qb {
// QbBase
class QBKERNELAPI qbBase {
 public:
  static qbBase* getInterface();
  static scoped_refptr<IMessageKernel> getMessageKernel();
  static scoped_refptr<IMessageBond> getMessageBond();
  static scoped_refptr<IMessageProcess> getMessageProcess();
  static scoped_refptr<IMessageSync> getMessageSync();
  static scoped_refptr<INetworkService> getNetworkService();

  virtual int32_t init(const char* exepath) = 0;
  virtual int32_t terminate() = 0;

 protected:
  qbBase() {}
  virtual ~qbBase() {}
};
}  // namespace qb
#endif  // _PR_BASE_H_
